<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
      .red {
          color: red;
      }

      .green {
          color: green;
      }

      .gold {
          color: gold;
      }

      .trans {
          transition: all 2s;
      }
  </style>
</head>
<body>
  <div id="app">
      <h1 v-if="num >= 10 && num < 25" class="red trans" @click = "addNum">小于25 {{num}}</h1>
      <h1 v-else-if="num >= 25 && num < 35" class="green trans" @click = "addNum">小于35 {{num}}</h1>
      <h1 v-else class="gold trans" @click = "addNum">大于35 {{num}}</h1>
  </div>
  <script src="./vue.js"></script>
  <script>
    var vm = new Vue({
      el:'#app',
      data:{
          flag:true,
          num:10
      },
      methods:{
       changeFlag() {
        this.flag = !this.flag
       },
       addNum() {
           this.num = this.num + 5;
           this.num >= 40 ? this.num = 10 : this.num
       }
      }
     });
  </script>
</body>
</html>
